from django.test import TestCase
from django.core.urlresolvers import reverse

class ViewTests(TestCase):
    fixtures = ["test_tests", "test_useragents", "test_results", "test_auth"]
    def testHome(self):
        response = self.client.get(reverse('site-home'))
        self.assertContains(response, "Browser Tests")
        NUM_TESTS = 34
        self.assertContains(response, "Number of tests: %s" % NUM_TESTS)
        NUM_RESULTS = 2
        self.assertContains(response, "Number of results: %s" % NUM_RESULTS)
        
    def testNotFound(self):
        response = self.client.get('/nosuchpage/')
        self.assertContains(response, "Page not found", status_code=404)

    def testAbout(self):
        response = self.client.get(reverse('site-about'))
        self.assertContains(response, "Contact")
